<template>
<ul>
  <li v-for="(card, index) in deck" v-bind:key="index">
    <router-link :to="getPath(cpath)(card.fingerprint)">
      {{ card.name }}
    </router-link>&nbsp;&#45;
    <span>{{ card.email }}</span>&nbsp;&#45;
    <span>{{ card.phone }}</span>
    <span style="display: none;">{{ card.fingerprint ? "set" : "none" }}</span>
  </li>
</ul>
</template>

<script>
export default {
    name: "Deck",
    props: ["deck","cpath"],
    methods: {
        getPath: cpath => fingerprint => {
            return `${cpath}${encodeURIComponent(fingerprint || '')}`
        }
    }
}
</script>
